/**************************************************************************************
*
*	Copyright (C) 2009 - 2012 Brent Andrew O. Chua - See LICENSE.txt for more info.
*		
*	Filename	-	AABB.h
*
*	Description -	Axis-aligned bounding box.
*
*	Comments	-
*
*	Modification History:
*			Name			   Date					Description
*			MrCodeSushi	-	08/02/2012	-	Creation of this file
**************************************************************************************/
#ifndef _PSX_BOUNDING_BOX_H_
#define _PSX_BOUNDING_BOX_H_

#include "PulseSTD.h"
#include "Vector3.h"
#include "Matrix4x4.h"

namespace Pulse
{
	class AABB
	{
	public:

		AABB( void );

		~AABB( void );

		Vector3 * GetMin( void ) { return &m_min; }

		Vector3 * GetMax( void ) { return &m_max; }

		AABB & Reset( void );

		// NOTE: Adjust the container to contain the added point.
		AABB & ContainPoint( Vector3 *pPoint );

		// NOTE: Moves the bounding box to the specified translation
		AABB & Translate( Vector3 *pTranslate );

		// NOTE: Transform the bounding box by the matrix transform specified.
		//	New bounding box
		//	extends describe the maximum volume that will entirely surround
		//  the prior box in this new space.
		AABB & Transform( Matrix4x4 *pTransform );

		BOOL TestAABB( const AABB *pAABB ) const;

		BOOL TestPoint( Vector3 *pPoint ) const;

		//BOOL TestFrustrum( ... ) const;

	private:

		Vector3 m_min;
		Vector3 m_max;
	};
}

#endif /* _PSX_BOUNDING_BOX_H_ */